package finalfrontier;

import java.util.Random;
/**Superclasse de tous les beams
 * @author Nicolas Roy Boourdages
 */
public class Beam {
    
    private String name;
    private int cost;
    private float[] color;
    private Random random;
    
    public Beam(String name, int cost, float[] color) {
        super();
        this.name = name;
        this.cost = cost;
        this.color = color;
        this.random = new Random();
    }

    public String getName() {
        return name;
    }
    
    public void singleShot(int i, int j){
        for (int q = -Constants.BEAM_SIZE; q <= Constants.BEAM_SIZE; q++){ 
            for (int w = -Constants.BEAM_SIZE; w <= Constants.BEAM_SIZE; w++){
                if ((i + q) >= 0 && (j + w) >= 0 && (i + q) < Constants.REAL_SIZE_X && (j + w) < Constants.REAL_SIZE_Y){
                    beamEffect(i,j,q,w);
                }
            }
        }
        
    }
    
    public void beamEffect(int i, int j, int q, int w){}

    public int getCost() {
        return cost;
    }

    public float[] getColor() {
        return color;
    }

    public void setColor(float[] color) {
        this.color = color;
    }

    public Random getRandom() {
        return random;
    }
}
